# -*- coding:utf-8 -*-
import cookielib, urllib2, urllib,re


url="http://www.google.cn/music/search?q=没那么简单+黄小琥"
html = urllib2.urlopen(url).read()

pat = re.compile(r"title=\"下载\".*window\.open\(&quot;(?P<url>.*)&quot;")
result = pat.search(html)
if result :
    url = "http://www.google.cn" + result.group("url")
    url = url.decode("utf-8")
    url = urllib.unquote_plus(url)
    print url
    #url = urllib.unquote_plus(url)
else :
    print "cant't find donwload link"

"""
print  html
aa = open("/project/test.html","w")
aa.write(html)
aa.close()
"""

#print encoded_args

url = "http://www.google.cn/music/url?q\x3dhttp://g.top100.cn/16667639/html/download.html?id=S277842c2f78d639c\x26resnum\x3d2\x26ct\x3ddl\x26cad\x3dsong_search\x26cd\x3d1\x26ei\x3dR1zBTZBOh7CQBf23hcUB"
print urllib.unquote_plus(url)
